package fr.upstlse.glre.client.widgets;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;

public class ListBox extends Composite {
	private Label label;
	private com.google.gwt.user.client.ui.ListBox listbox;
	private String value;
	
	public ListBox(String pLabel, String pName) {
		label = new Label(pLabel + ": ");
		listbox = new com.google.gwt.user.client.ui.ListBox();
		listbox.setName(pName);
		value = "";
		HorizontalPanel lPanel = new HorizontalPanel();
		lPanel.add(label);
		lPanel.add(listbox);
		initWidget(lPanel);
	}

	public Label getLabel() {
		return label;
	}

	public void setLabel(Label label) {
		this.label = label;
	}

	public com.google.gwt.user.client.ui.ListBox getListbox() {
		return listbox;
	}

	public void setListbox(com.google.gwt.user.client.ui.ListBox listbox) {
		this.listbox = listbox;
	}

	public String getValue() {
		value = listbox.getValue(listbox.getSelectedIndex());
		return value;
	}

	/*public void setValue(String value) {
		this.value = value;
	}*/
}
